1. Field of the Invention
The present invention relates generally to computer systems. More particularly, the present invention relates to managing concurrent access among computers to a bitmap stored on disk storage.
2. Description of the Related Art
Software applications can be executed across multiple servers, such as a cluster of servers (“distributed applications”). Distributed applications are making increasing use of bitmap structures to track state and control the operation of various features. A number of these bitmap structures can be located on disk storage so that the bitmap data can survive failure of one or more servers. Some bitmaps can be related to the storage on which they reside (e.g., a “dirty” sector list, a mirror resynchronization scoreboard, etc.). Many bitmaps are related to general application features, such as cluster membership and the like. One disadvantage for storing bitmaps on a disk, rather than in memory, is the absence in disk command sets of an equivalent to a “test and set” instruction found in many central processing unit (CPU) command sets. For a number of architectural reasons that have been in place for more than 20 years, disk command sets, such as Advanced Technology Attachment (ATA) and Small Computer System Interface (SCSI) command sets, only support data transfers in a single direction per command. Thus, in order to change the status of a single bit in a bitmap on disk, an application has to read all or a portion of the bitmap structure, change the status of the desired bit, and write the result back to the storage. If during that process another initiator begins a similar process to update a different bit, the state of the bitmap on the disk can become corrupted.
One technique for avoiding corruption of bitmaps stored on a disk shared by multiple computers is to implement a temporary restriction that allows exclusive access from only a single computer (e.g., “write exclusive” access) to the disk for the entire duration of the bitmap update process. However, this technique represents a significant impediment to the operation of a distributed application, given that by definite such an application relies on shared access to disk storage. Such exclusive access can either be established within the distributed application by the use of global locks and/or a designated bitmap manager, or by the use of SCSI Reservations or Persistent Reservations. The former creates a bottleneck and single point of failure within the application, and the latter adds significant overhead to the storage access.
The need to establish exclusive access during a bitmap update can be avoided if a disk command was capable of changing the state of one or more bits in the bitmap structure regardless of the setting of the rest of the structure. This would allow the “read-update-write” cycle to take place within the storage device as an atomic series of actions. However, such a command would solve only part of the problem. While such a command provides a mechanism to set individual bits in a bitmap, there is also a need for an application to be able to clear multiple bits in the bitmap at more infrequent intervals. Presently, such a bitmap clear process still requires exclusive access to be established.